package com.hui10.mediaplayer.presenter

import com.hui10.mediaplayer.base.BasePresenter
import com.hui10.mediaplayer.base.BaseView
import com.hui10.mediaplayer.model.YueDanBean
import com.hui10.mediaplayer.net.ResponseHandler
import com.hui10.mediaplayer.net.request.YueDanRequest
import com.hui10.mediaplayer.view.YueDanView

/**
 * Author: Created by lucus on 2019/5/30.
 * E-mail: mcphilex1989@gmail.com
 * Tel: 15652608401
 */
class YueDanPresenter(private val yueDanView: BaseView<YueDanBean>?) : BasePresenter<YueDanBean>(yueDanView),
    ResponseHandler<YueDanBean> {

    override fun onError(type: Int, msg: String?) {
        yueDanView?.onError(type, msg)
    }

    override fun onSuccess(type: Int, result: YueDanBean?) {
        yueDanView?.onSuccess(type, result)
    }

    override fun loadData(type: Int) {
        YueDanRequest(type, 0, this).excute()
    }

    override fun loadMoreData(type: Int, offset: Int) {
        YueDanRequest(type, offset, this).excute()
    }
}